package com.idata.model.response;

import com.idata.model.utils.DefaultImgUrlManager;
import com.idata.model.utils.ImgReplaceUtils;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.List;

@Data
public class DisputeRelationResponse implements Comparable<DisputeRelationResponse> {
    private List<String> relationshipList = new ArrayList<>();
    private String name = "";
    private String idCard = "";
    private long disputeTotalCount;
    private long personDisputeCount;
    private String avatarUrl;

    public String getAvatarUrl() {
        return StringUtils.isEmpty(avatarUrl) ? DefaultImgUrlManager.DEFAULT_AVATAR_IMG_URL : ImgReplaceUtils.replaceHost(avatarUrl);
    }

    @Override
    public int compareTo(DisputeRelationResponse other) {
        return (int) (this.getDisputeTotalCount() - other.getDisputeTotalCount());
    }
}
